local total = achievements.GetValue( "Zombie Survival: Reincarnate", "total", 0 )
if ( achievements.IsGamemode( "Zombie Survival" ) || total == 5 ) then

	local function PlayerRedeemed( msg )
		local redeemed = msg:ReadEntity()
		if ( redeemed == LocalPlayer() && total != 5 ) then
			total = math.Clamp( total + 1, 0, 5 )
			achievements.Update( "Zombie Survival: Reincarnate", total / 5, total .. "/5" )
			achievements.SetValue( "Zombie Survival: Reincarnate", "total", total )
		end
		return redeemed
	end
	usermessage.AddHook( "PlayerRedeemed", "Achievements.Zombie Survival:Reincarnate", PlayerRedeemed )

	achievements.Register( "Zombie Survival: Reincarnate", "Redeem yourself 5 times in Zombie Survival.", "achievements/zs_reincarnate", total / 5, total .. "/5" )
	
end